solving systems of linear congruences